performHapticFeedback

open fun performHapticFeedback(@NonNull view: View, feedbackConstant: Int): Boolean(source)

Perform a haptic feedback to the user for the view.

The framework will provide haptic feedback for some built in actions, such as long presses, but you may wish to provide feedback for your own widget.

The feedback will only be performed if isHapticFeedbackEnabled is true. Note: Check compatibility support for each feedback constant described at HapticFeedbackConstantsCompat.

Return

Whether the feedback might be performed - generally this result should be ignored

Parameters

view

The view.

feedbackConstant

One of the constants defined in HapticFeedbackConstantsCompat


open fun performHapticFeedback(@NonNull view: View, feedbackConstant: Int, flags: Int): Boolean(source)

Perform a haptic feedback to the user for the view.

This is similar to performHapticFeedback, with additional options. Note: Check compatibility support for each feedback constant described at HapticFeedbackConstantsCompat.

Return

Whether the feedback might be performed - generally this result should be ignored

Parameters

view

The view.

feedbackConstant

One of the constants defined in HapticFeedbackConstantsCompat

flags

Additional flags as per HapticFeedbackConstantsCompat